<?php
/**
 * Created by PhpStorm.
 * User: lele.wang
 * Date: 2018/2/1
 * Time: 18:04
 */

use Illuminate\Support\Facades\Auth;

return [

    // 后台的 URI
    'uri' => 'administrator',

    // 后台专属域名，没有的话可以留空
    'domain' => '',
    //后台绑定IP最大数目
    'backend_ips_max' => 5,
    'api_ips_max' => 10,
    'paginate' => [
        'limit' => 10,
    ],
    //支付方式
    'pay_types' => [
        'bankcard' => '银行卡',
        'alipay' => '支付宝',
        'wxpay' => '微信',
    ],

    /**
     * 后台菜单数组
     */
    'menu' => [
        [
            "id" => "system",
            "text" => "系统设置",
            "permission" => function () {
                return Auth::user()->can('manage_system');
            },
            "icon" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "system.users",
                    "text" => "用户管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_users');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "users.index",
                    "params" => [],
                ],
                [
                    "id" => "system.permissions",
                    "text" => "权限管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_permissions');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "permissions.index",
                    "params" => [],
                ],
                [
                    "id" => "system.roles",
                    "text" => "角色管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_permissions');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "roles.index",
                    "params" => [],
                ],
            ],
        ],
        [
            "id" => "setting",
            "text" => "站点设置",
            "permission" => function () {
                return Auth::user()->can('manage_setting');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "setting.basic",
                    "text" => "站点信息",
                    "permission" => function () {
                        return Auth::user()->can('manage_setting');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "administrator.site.basic",
                    "params" => [],
                ],
                [
                    "id" => "setting.company",
                    "text" => "公司信息",
                    "permission" => function () {
                        return Auth::user()->can('manage_setting');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "administrator.site.company",
                    "params" => [],
                ],
                [
                    "id" => "setting.contact",
                    "text" => "联系方式",
                    "permission" => function () {
                        return Auth::user()->can('manage_setting');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "administrator.site.contact",
                    "params" => [],
                ],
            ],
        ],
        [
            "id" => "plat.manager",
            "text" => "平台",
            "permission" => function () {
                return Auth::user()->can('manage_main_game_plat');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "plat.manager",
                    "text" => "平台管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_main_game_plat');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "main_game_plat.index",
                    "params" => [],
                    "children" => []
                ],
                [
                    "id" => "plat.manager",
                    "text" => "平台游戏",
                    "permission" => function () {
                        return Auth::user()->can('manage_game_list');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "game_list.index",
                    "params" => [],
                    "children" => []
                ],
                [
                    "id" => "plat.manager",
                    "text" => "限红盘口",
                    "permission" => function () {
                        return Auth::user()->can('manage_quota_handicap');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "quota_handicap.index",
                    "params" => [],
                    "children" => []
                ],
                [
                    "id" => "plat.manager",
                    "text" => "赔率盘口",
                    "permission" => function () {
                        return Auth::user()->can('manage_odds_handicap');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "odds_handicap.index",
                    "params" => [],
                    "children" => []
                ],
            ]
        ],
        [
            "id" => "agent.manager",
            "text" => "业务代理",
            "permission" => function () {
                return Auth::user()->can('manage_agent');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "agent.manager",
                    "text" => "代理管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_agent');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "agent.index",
                    "params" => [],
                ],
            ]
        ],
        [
            "id" => "agent.manager",
            "text" => "代理网站",
            "permission" => function () {
                return Auth::user()->can('manage_site');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "site.manager",
                    "text" => "网站管理",
                    "permission" => function () {
                        return Auth::user()->can('manage_site');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "site.index",
                    "params" => [],
                ],
                [
                    "id" => "agent.withdrawal",
                    "text" => "代理提款",
                    "permission" => function () {
                        return Auth::user()->can('self_agent');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "agent.withdrawal",
                    "params" => [],
                ],
                [
                    "id" => "agent.withdrawal.flow",
                    "text" => "代理提款申请",
                    "permission" => function () {
                        return Auth::user()->can('self_agent');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "agent.withdrawal.flow",
                    "params" => [],
                ],
                [
                    "id" => "agent.withdrawal.flow",
                    "text" => "代理网站收益",
                    "permission" => function () {
                        return Auth::user()->can('self_agent');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "agent.earning",
                    "params" => [],
                ],
            ]
        ],
        [
            "id" => "game.record",
            "text" => "游戏记录",
            "permission" => function () {
                return Auth::user()->can('manage_player_bet_flow');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "game.record",
                    "text" => "游戏记录报表",
                    "permission" => function () {
                        return Auth::user()->can('manage_player_bet_flow');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "player_bet_flow.index",
                    "params" => [],
                ],
            ]
        ],
        [
            "id" => "player",
            "text" => "玩家管理",
            "permission" => function () {
                return Auth::user()->can('manage_player_transfer');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "player.transfer",
                    "text" => "玩家转账",
                    "permission" => function () {
                        return Auth::user()->can('manage_player_transfer');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "player_transfer.index",
                    "params" => [],
                ],
            ]
        ],
        [
            "id" => "finance",
            "text" => "财务中心",
            "permission" => function () {
                return Auth::user()->can('site_agent_public');
            },
            "icon" => "",
            "route" => "",
            "params" => [],
            "children" => [
                /*[
                    "id" => "finance.deposit",
                    "text" => "网站存款",
                    "permission" => function () {
                        return Auth::user()->can('self_site');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "users.index",
                    "params" => [],
                ],*/
                [
                    "id" => "finance.plat_transform",
                    "text" => "平台分数互转",
                    "permission" => function () {
                        return Auth::user()->can('site_mutual_transfer');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "site.plat_mutual_transfer",
                    "params" => [],
                ],
                [
                    "id" => "finance.transform",
                    "text" => "平台加分",
                    "permission" => function () {
                        return Auth::user()->can('self_site');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "site.bonus_point",
                    "params" => [],
                ],
                [
                    "id" => "finance.deposit.record",
                    "text" => "存款记录",
                    "permission" => function () {
                        return Auth::user()->can('site_agent_public');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "site.deposit.log",
                    "params" => [],
                ],
                [
                    "id" => "finance.transform.record",
                    "text" => "平台加分记录",
                    "permission" => function () {
                        return Auth::user()->can('self_site');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "site.bonus_point_log",
                    "params" => [],
                ],
            ],
        ],


    ],

    // 快捷方式
    'shortcut' => [
        [
            "id" => "dashboard",
            "text" => "控制台",
            "permission" => function () {
                return true;
            },
            "icon" => "",
            "route" => "administrator.dashboard",
            "params" => [],
            "link" => "",
            "children" => [],
        ],
        [
            "id" => "develop",
            "text" => "开发调试",
            "permission" => function () {
                return Auth::user()->can('manage_develop');
            },
            "icon" => "",
            "link" => "",
            "route" => "",
            "params" => [],
            "children" => [
                [
                    "id" => "log",
                    "text" => "系统日志",
                    "permission" => function () {
                        return Auth::user()->can('manage_develop');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "log.laravel",
                    "params" => [],
                ],
                [
                    "id" => "task",
                    "text" => "任务日志",
                    "permission" => function () {
                        return Auth::user()->can('manage_develop');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "log.jobs",
                    "params" => [],
                ],
                [
                    "id" => "queue",
                    "text" => "队列状态",
                    "permission" => function () {
                        return Auth::user()->can('manage_develop');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "log.queue",
                    "params" => [],
                ],
                [
                    "id" => "behavior",
                    "text" => "行为日志",
                    "permission" => function () {
                        return Auth::user()->can('manage_develop');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "log.behavior",
                    "params" => [],
                ],
                [
                    "id" => "business",
                    "text" => "业务日志",
                    "permission" => function () {
                        return Auth::user()->can('manage_develop');
                    },
                    "icon" => "",
                    "link" => "",
                    "route" => "log.business",
                    "params" => [],
                ],
            ],
        ],
        [
            "id" => "github",
            "text" => "Github",
            "permission" => function () {
                return Auth::user()->can('manage_develop');
            },
            "icon" => "",
            "route" => "",
            "params" => [],
            "link" => "https://github.com/wanglelecc",
            "children" => [],
        ],
    ],

];